# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=vte
pkgver=0.28.2
pkgrel=14
pkgdesc="Virtual Terminal Emulator library"
url="http://www.gnome.org"
arch="all"
license="LGPL-2.0-or-later"
options="suid"
depends_dev="pango-dev gtk+2.0-dev"
makedepends="$depends_dev intltool ncurses-dev"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
source="https://download.gnome.org/sources/vte/${pkgver%.*}/vte-$pkgver.tar.bz2
	allow_alt_in_terminal.patch
	fix-includes.patch
	vte-0.28.2-paste-fix.patch
	CVE-2012-2738.patch
	"

# secfixes:
#   0.28.2-r12:
#     - CVE-2012-2738

prepare() {
	default_prepare
	update_config_sub
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--libexecdir=/usr/lib/vte \
		--localstatedir=/var \
		--disable-static \
		--disable-python
	make
}

package() {
	make DESTDIR="$pkgdir" install
	ln -sf /usr/share/vte/termcap-0.0 "$pkgdir"/usr/share/vte/termcap
}

check() {
	make check
}

sha512sums="271aecbc0444c424afb70d81838d0f6f49957a3b74d3952c0b97fadacfe359eab989abae03b9b64a8b598abdb189db00ee534254d8044e496906c51947d314d1  vte-0.28.2.tar.bz2
a4786a97a5caa42db3b29808c3542777684fcf7d931a116d4e3d847e859a64fb59a2d5b60927dc8e5c2733efc55c29aa4d30aeb02597aff5f034c172cc528833  allow_alt_in_terminal.patch
bf8174189fe842d171c04633ce1f8b920f3a515108db48bfe1fff7e537960a88f7439a55b283b6ade6ebfe78ab8ff2473f3be2d062dc00aa74b93a13624b4d3c  fix-includes.patch
488a3d55c4afb5b74057c97adfaafc1cc6de697c157a2009905632af2137305eee671b1e0b294f153b37ee97e79d402d6e44fc19945f8c2dd332e95eef1b144f  vte-0.28.2-paste-fix.patch
e5639d94fd455195c354d03cab04bbb73eff98bc540c813cccf4ab5eb793f4c8ae645fcf2bd502924ed4d38412101341deaf2d28ea8aaea3530a98ffbba8256d  CVE-2012-2738.patch"
